package java.com.qf.log4j;

import org.apache.log4j.Logger;

public class TestMain {
    private  static  boolean enableDebug = false;

    private  static Logger logger = Logger.getLogger(TestMain.class);

    public static void main(String[] args) {

        for (int i = 0; i < 2048; i++) {
            logger.fatal("发生灾难性故障了");
            logger.trace("hello trace");
            logger.debug("hello debug");
            logger.info("hello info");
            logger.warn("hello warn");
            logger.error("hello error");
            logger.fatal("hello fatal");
        }
            logger.trace("程序运行到第48行了");
            if (enableDebug) {
                logger.debug("这是debug信息");
            }
            logger.info("这是输出的信息");
            try{
                int y= 1/0;
            }catch (Exception e){
                e.printStackTrace();
                logger.error("这是发生错误了");
            }

        }
    }

